package cn.walls1717.ggkt.live.service.impl;

import cn.walls1717.ggkt.live.mapper.LiveCourseConfigMapper;
import cn.walls1717.ggkt.live.service.LiveCourseConfigService;
import cn.walls1717.ggkt.model.live.LiveCourseConfig;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 直播课程配置表服务实现类
 *
 * @author walls1717
 * @since 2022/07/23
 */
@Service
public class LiveCourseConfigServiceImpl extends ServiceImpl<LiveCourseConfigMapper, LiveCourseConfig> implements LiveCourseConfigService {

    /**
     * 根据直播课程id查询配置信息
     */
    @Override
    public LiveCourseConfig getCourseConfigByCourseId(Long id) {
        LambdaQueryWrapper<LiveCourseConfig> lqw = new LambdaQueryWrapper<>();
        lqw.eq(LiveCourseConfig::getLiveCourseId, id);
        return this.getOne(lqw);
    }

}
